<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>易购GO_淘宝网女装新款_淘宝网商城_淘宝网网上购物</title>
<{assign var="layout" value="4"}>
<{include file="../_meta.html"}>
</head>

<body>
<{include file="../_top.html"}>
<div id="Container">

	<!-- header -->
	<div id="Header" class="clearfix">
		<{assign var="menu" value="home"}>
		<{include file="../_header.html"}>
	</div>
	<!-- /header -->
	
	<!-- body -->
	<div id="Body" class="clearfix">
	
		<!-- main -->
		<div id="Wrapper">
			<div id="Main">
				<div class="com_title"><div class="com_title_in"><div class="com_title_inner"><h2>我的订单</h2></div></div></div>
				
				<div class="content" id="user_body">
				
					<!-- form -->
					<div class="edit_tbl">
						<form id="searchForm" method="POST" action="">
						<table width="100%" cellspacing="0" cellpadding="0" border="0">
							<tr>
								<th>订单号：</th>
								<td><input type="text" class="input short" name="order_id" /></td>
							</tr>
							<tr>
								<th>商品名称：</th>
								<td><input type="text" class="input short" name="item_title" /></td>
							</tr>
							<tr>
								<th>订单日期：</th>
								<td>
								从 <input type="text" class="input short cal_input" name="start_date" id="dateStart" />
								&nbsp;<img style="cursor:pointer;" id="btStart" src="<{$domain}>images/calendar.gif">
								&nbsp;到&nbsp;<input type="text" class="input short cal_input" name="end_date" id="dateEnd" />
								&nbsp;<img style="cursor:pointer;" id="btEnd" src="<{$domain}>images/calendar.gif">
								</td>
							</tr>
							<tr>
								<th>&nbsp;</th>
								<td height="49"><span class="gray_btn"><input type="submit" value="查询"></span></td>
							</tr>
						</table>
						</form>
					</div>
					
					<!-- list -->
					<h4 class="title">订单列表</h4>
					<div id="list"></div>
				</div>
				
				<div id="loding" style="position: fixed; z-index: 9999; left: 40%; top: 50%; display: none;"><img src="<{$domain}>images/loading.gif" /></div>
			</div>
		</div>
		<!-- /main -->
		
		<!-- sidebar -->
		<div id="SideBar"><{include file="_menu.html"}></div>
		<!-- /sidebar -->
	</div>
	<!-- /body -->
	
	<!-- footer -->
	<div id="Footer" class="clearfix"><{include file="../_footer.html"}></div>
	<!-- /footer -->
</div>
</body>
</html>

<!-- JS -->
<{JS}>
<script type="text/javascript">
///
var startCal = new Calendar({
	inputField: "dateStart",
	dateFormat: "%Y-%m-%d",
	trigger: "btStart",
	onSelect: function() {
		var date = Calendar.intToDate(this.selection.get());
		endCal.args.min = date;
		endCal.redraw();
		this.hide();
	}
});
var endCal = new Calendar({
	inputField: "dateEnd",
	dateFormat: "%Y-%m-%d",
	trigger: "btEnd",
	onSelect: function() {
		var date = Calendar.intToDate(this.selection.get());
		startCal.args.max = date;
		startCal.redraw();
		this.hide();
	}
});

///
function loadList(url) {
	$("#loding").show();
	if (url == 'undefined') url = "<{url r='user/main/order'}>";
	
	$("#searchForm").ajaxSubmit({
		type: "POST", url: url, data: {},
		success: function(data) {
			$("#loding").hide();
			$("#list").html(data);
			
			$("#list a").unbind().click(function() {
				var url = $(this).attr("href");
				loadList(url);
				return false;
			});
		}
	});
}

/* 初始化 */
$(function() {
	loadList();
});

/* 表单 */
$("#searchForm").validate({
	submitHandler: function() {
		loadList();
		return false;
	}
});
</script>
